CBF Lab

Interactive Educational Platform for Control Barrier Functions - Explore Safety-Critical Control Theory

2D Point Robot with Obstacle Avoidance

1.25
Min CBF Value h(x)
SAFE
Safety Status
0%
Control Modification

CBF Theory & Visualization

Control Barrier Function Math:

h(x) = ||x - x_obs|| - r_safe ≥ 0
CBF Constraint: ḣ(x) = ∇h(x)·ẋ ≥ -α·h(x)
where ∇h(x) = (x - x_obs) / ||x - x_obs||

Interactive Elements:

  • Green Robot - Safe, nominal control active
  • Orange Robot - CBF safety filter modifying control
  • Red Robot - Constraint violated (shouldn't happen with CBF)
  • Red Obstacles - Click and drag to reposition
  • Dashed Circle - Safe set boundary
  • Blue Trail - Robot trajectory
  • Gray Arrow - Nominal control (desired)
  • Orange Arrow - CBF-filtered safe control

Click on canvas to set new goal position!

Double Integrator with HOCBF

250
Position
0
Velocity
100
h₀(x)
0
Control u

HOCBF Theory

High-Order Control Barrier Functions:

For a double integrator system (ẍ = u) with position constraint h₀(x) ≥ 0, we recursively define new barrier functions until the control u appears.

h₀(x) = x - x_obs
h₁(x,ẋ) = ḣ₀ + α₁·h₀ = ẋ + α₁·h₀
CBF constraint: ḣ₁ + α₂·h₁ ≥ 0
ḣ₁ = ẍ + α₁·ḣ₀ = u + α₁·ẋ
(u + α₁·ẋ) + α₂·h₁ ≥ 0
u ≥ -α₁·ẋ - α₂·h₁

Multi-Agent Collision Avoidance

45
Min Distance
0
Active CBFs
0
Collisions